
from enum import StrEnum

from pydantic import BaseModel, Field


class CodeSenderType(StrEnum):
    """发送类型"""
    REGISTER = "1" # 注册
    FORGET_PASSWORD = "2" # 忘记密码

class CodeTargetType(StrEnum):
    """发送目标类型"""
    EMAIL = "1" # 邮箱
    PHONE = "2" #  手机


class SendCodeRequest(BaseModel):
    """发送验证码请求数据格式"""
    email: str | None = Field(None, min_length=3, max_length=20)
    phone: str | None = Field(None, min_length=11, max_length=11)
    sender_type: CodeSenderType = Field(...,description="发送类型 1:注册 2:忘记密码")
    target_type: CodeTargetType = Field(..., description="发送目标类型 1: 邮箱 2: 手机")

class SendCodeResponse(BaseModel):
    """发送验证码响应数据格式"""
    message: str